#include "comm.hpp"

int main()
{
    //打开命名管道
    int fd = open("mkfifo", O_WRONLY, 0666);
    if(fd == -1)
    {
        perror("mkfifo open");
        exit(MKFIFO_OPEN_ERR);
    }
    std::cout << "client open mkfifo done" << std::endl;

    std::string line;
    while(true)
    {
        std::cout << "please@";
        std::getline(std::cin, line);
        write(fd, line.c_str(), line.size());
    }

    close(fd);
    return 0;
}